/**
 * @name TestPage
 * @author darcrand
 * @desc
 */

import React, { Component } from 'react'
import { Prompt } from 'react-router-dom'
import { encrypt, decrypt } from '@/utils/cryptojs-aes'

const str = 'abc789'

class TestPage extends Component {
  state = {
    content: '',
  }

  en = () => {
    const enStr1 = encrypt(str)
    const enStr2 = encrypt(str)
    const d1 = decrypt(enStr1)
    const d2 = decrypt(enStr2)
    console.log({ enStr1, enStr2, d1, d2 }, d1 === d2)
  }

  render() {
    return (
      <div>
        <Prompt message='是否确定离开这个页面 ?' />

        <h1>测试页面</h1>

        <hr />
        <button onClick={this.en}>加密</button>
      </div>
    )
  }
}

export default TestPage
